<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/header.jsp"%>
<div id="content" class="col-lg-10 col-sm-10">
	<div>
		<ul class="breadcrumb">
			<li><a href="#">基础信息</a></li>
			<li><a href="#">物资管理</a></li>
		</ul>
	</div>

	<div class=" row">
			<div class="box col-md-12">
				<div class="box-inner">
					<div class="box-header well" data-original-title="">
						<h2>
							<i class="fa fa-book"></i> 物资信息管理
						</h2>

					<!-- 	<div class="box-icon">
							<a> <i
								class="glyphicon glyphicon-plus"></i></a>
						</div> -->
					</div>
					<div class="box-content">
						<div class="alert alert-info">角色:${operator.roleName},
							您可以对物资信息进行管理,删除数据前请及时备份!</div>

						<form class="form-horizontal" action="${pageContext.request.contextPath}/base/goodslist.html" method="POST">
							<input type="hidden" name="pageIndex" value="1" /> <label
								for="goodsCode"> 物资编号: <input type="text"
								name="goodsCode" value="${goodsCode}" id="goodsCode">
							</label> <label for="goodsCode"> 物资名称: <input type="text"
								name="goodsName" value="${goodsName}" id="goodsName">
							</label> <label class="control-label" for="type"> 物资类型: <select
								name="type">
									<c:if test="${typelist != null && fn:length(typelist) != 0}">
										<option value="">--请选择--</option>
										<c:forEach var="dict_status" items="${typelist}">
											<option
												<c:if test="${dict_status.valueId == type}">
														selected="selected"</c:if>
												value="${dict_status.valueId}">${dict_status.valueName}</option>
										</c:forEach>
									</c:if>
							</select>
							</label>

							<button type="submit" class="btn btn-primary querybtn">
								<i class="fa fa-search"></i>查 询
							</button>
							
						</form>
						</br>
						<table class="table table-striped table-bordered responsive">
							<thead>
								<tr>
									<th>物资编号</th>
									<th>物资名称</th>
									<th>物资类型</th>
									<th>库存数量</th>
									<th>单位</th>
									<th>进价(元)</th>
									<th>建议零售价(元)</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${goodlist}" var="goods">
									<tr>

										<td class="center">${goods.goodsCode}</td>
										<td class="center">${goods.goodsName}</td>
										<td class="center">${goods.typeName}</td>
										<td class="center">${goods.num == null ? 0 : goods.num}</td>
										<td class="center">${goods.unit}</td>
										<td class="center">${goods.sellPrice}</td>
										<td class="center">${goods.fixPrice}</td>
										<td class="center">
										<a class="btn btn-success goodsview" 
											url="${pageContext.request.contextPath}/"
										    goods-code="${goods.goodsCode}"> <i
												class="glyphicon glyphicon-zoom-in icon-white"></i> 查看
										</a>
										<a class="btn btn-info goodsedit"
											goods-code="${goods.goodsCode}"
											url="${pageContext.request.contextPath}/">
												<i class="glyphicon glyphicon-edit icon-white"></i> 编辑
										</a></td>

									</tr>
								</c:forEach>
							</tbody>
						</table>

						<div class="col-md-12">
						<div class="dataTables_info" id="DataTables_Table_0_info">
							共${pages.getTotalCount()}条记录
							${pages.getPage()}/${pages.getPageCount()}页</div>
					</div>

					<div class="col-md-12 center-block">
						<div class="dataTables_paginate paging_bootstrap pagination">
							<ul class="pagination">
								<c:choose>
									<c:when test="${pages.page == 1}">
										<li class="active"><a href="javascript:void(0);"
											title="首页">首页</a></li>
									</c:when>
									<c:otherwise>
										<li class=""><a
											href="javascript:page_nav(document.forms[0],1);">首页</a></li>
									</c:otherwise>
								</c:choose>
								<c:if test="${pages.getPrevNumPages() != null && fn:length(pages.getPrevNumPages()) != 0}">
									<c:forEach items="${pages.getPrevNumPages()}" var="num">
										<li class=""><a
											href="javascript:page_nav(document.forms[0],${num});"
											title="${num}">${num}</a></li>
									</c:forEach>
								</c:if>

								<li class="active"><a href="#" title="${pages.page}">${pages.page}</a>
								</li>

								<c:if test="${pages.getNextNumPages() != null && fn:length(pages.getNextNumPages()) != 0}">
									<c:forEach items="${pages.getNextNumPages()}" var="num">
										<li class=""><a
											href="javascript:page_nav(document.forms[0],${num});"
											title="${num}">${num}</a></li>
									</c:forEach>
								</c:if>
								
								<c:choose>
									<c:when test="${pages.page == pages.getPageCount()}">
										<li class="active"><a href="javascript:void(0);"
											title="尾页">尾页</a></li>
									</c:when>
									<c:otherwise>
										<li class=""><a
											href="javascript:page_nav(document.forms[0],${pages.getPageCount()});">尾页</a></li>
									</c:otherwise>
								</c:choose>
								
							</ul>
						</div>
					</div>


					</div>
				</div>
			</div>
			<!--/span-->
</div>
</div>

<div class="modal fade" id="viewGoods" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>查看物资信息</h3>
	                </div>
	                <div class="modal-body">
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >物资编号:</span>
                  				<input type="text" readonly="readonly" id="v_goodsCode" name="goodsCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>物资名称:</span>
                  				<input type="text" id="v_goodsName" name="goodsName" class="form-control" readonly="readonly"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >物资类型:</span>
                  				<input type="text" readonly="readonly" id="v_type" name="typeName" class="form-control"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >库存数量:</span>
                  				<input type="number" id="v_num" name="num" class="form-control" readonly="readonly"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >单 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位:</span>
                  				<input type="text" id="v_unit" name="unit" class="form-control"  readonly="readonly"/>
                  				
                  		</div>  
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >售&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</span>
                  				<input type="text" id="v_sellPrice" name="sellPrice" class="form-control" readonly="readonly"/>
                  				
                  		</div>    
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >进&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</span>
                  				<input type="text" id="v_fixPrice" name="fixPrice" class="form-control" readonly="readonly"/>
                  				
                  		</div>        
                  		 <div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>创建人:</span>
                  				<input type="text" id="v_createBy" name="createBy" class="form-control" readonly="readonly"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >创建时间:</span>
                  				<input type="text" id="v_createDate" name="createDate" class="form-control" readonly="readonly"/>
                  				
                  		</div>          		
                  		<div class="form-group col-md-12 col-sm-12 col-xs-12">
                				<span >物资描述:</span>
                				<textarea id="v_desc" name="desc" readonly="readonly" class="form-control col-md-12 col-sm-12 col-xs-12"></textarea>
                  		</div>
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">关闭</a>
	                </div>
	                
	            </div>
	        </div>
       
    </div>

 <div class="modal fade" id="modifyGoods" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true"  data-backdrop="static">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="modifyForm" action="${pageContext.request.contextPath}/basic/goods/savemodify" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>修改物资信息</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="modify-errtip" class="alert alert-info" style="display:none;"></ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >物资编号:</span>
                  				<input type="text" readonly="readonly" id="m_goodsCode" name="goodsCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>物资名称:</span>
                  				<input type="text" id="m_goodsName" name="goodsName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >物资类型:</span>
                  				<input type="text" readonly="readonly" id="m_type" name="typeName" class="form-control"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >库存数量:</span>
                  				<input type="number" id="m_num" name="num" class="form-control" readonly="readonly"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >单 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位:</span>
                  				<input type="text" id="m_unit" name="unit" class="form-control" required="required"/>
                  				
                  		</div>  
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >售&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</span>
                  				<input type="text" id="m_sellPrice" name="sellPrice" class="form-control" required="required"/>
                  				
                  		</div>    
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >进&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价:</span>
                  				<input type="text" id="m_fixPrice" name="fixPrice" class="form-control" required="required"/>
                  				
                  		</div>                    		
                  		<div class="form-group col-md-12 col-sm-12 col-xs-12">
                				<span >物资描述:</span>
                				<textarea id="m_desc" name="desc" class="form-control col-md-12 col-sm-12 col-xs-12"></textarea>
                  		</div>
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">关闭</a>
	              		<button type="submit" class="btn btn-primary">保存修改</button>
	                   <!-- <a href="#" id="modifyBtn" class="btn btn-primary" data-dismiss="modal">保存修改</a> -->
	                </div>
	                 </form>
	            </div>
	        </div>
       
    </div>


<%@ include file="../common/footer.jsp"%>
<script src="${pageContext.request.contextPath}/statics/local/js/goodslist.js"></script>




